package com.my.serviceimpl;

import com.baomidou.mybatisplus.enums.SqlLike;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.my.bean.*;
import com.my.mapper.BabyNursingMapper;
import com.my.service.BabyNursingService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 宝宝护理记录 服务实现类
 * </p>.
 *
 * @author 闫亚茹
 * @since 2018-08-24
 */
@Service
public class BabyNursingServiceImpl extends ServiceImpl<BabyNursingMapper, BabyNursing> implements BabyNursingService {

	public ResultPage<BabyNursing> selectMyPage(Map map,VoPage voPage,Long areaid,boolean admin){
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("page", (voPage.getPage() - 1)*voPage.getLimit());
		paramMap.put("limit", voPage.getLimit());
		List<BabyNursing> list = baseMapper.selectBabyNursing(map,paramMap,areaid,admin);
		Integer count = baseMapper.countMyPage(map,paramMap,areaid,admin);
		ResultPage<BabyNursing> resultPage=new ResultPage<>();
		resultPage.setCode(0);
		resultPage.setCount(count);
		resultPage.setMsg("成功");
		resultPage.setData(list);
		return resultPage;

	}
	@Override
	public  List<BabyNursing> selectBabyNursing(){return  null; }





}
